aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/invoice/[id]/memo/+page.server.ts
blob: a26096589f8b3e880bb4956a114745523c8e3c3d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
import invoice from "$lib/invoice";
import { redirect } from "@sveltejs/kit";

export async function load({ parent, params }) {
	const { invoice } = await parent();
	if (!invoice.amount) {
		redirect(307, `/invoice/${invoice.id}`);
	}
}

export const actions = {
	default: invoice,
};